Skip to content

fix(notifications): workspace mark as read clears the chat alert on the phone - #33713

Merged
AmoabaKelvin merged 2 commits into
mainfrom
mobile-mark-read-phone-alert
Oct 26, 2026
Merged

AmoabaKelvin merged 2 commits into
mainfrom
mobile-mark-read-phone-alert

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​42 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​42
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​12 $\color{#cf222e}{\Huge{\mathbf{−}}}$​7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​5

ELI5

When an agent chat finishes, Orca can send an alert to your paired phone. Clicking "Mark as read" on the workspace row on the desktop cleared the dot, but the phone alert stayed. Now Mark as read clears the phone alert too, the same way opening the chat or marking it read in Activity already does.

What Changed

  • Before: workspace Mark as read (the row's quick action and the context menu) removed the workspace's unread markers and asked main to dismiss notifications by pane key only. Chat completion alerts are tied to a position in the session's journal, and main only retires those when it receives a read that covers that position. With no such read, the phone alert stayed in the tray.
  • After: setWorkspaceUnreadByUser also emits an explicit subject read (emitAgentSubjectReads(..., 'explicit')) for every pane whose marker it cleared. The existing chat attention bridge turns that into a dismiss carrying the journal boundary (the edge that lit the row, never a later one), plus the host acknowledgement. This retires:
    • the alert desktop main relayed to its phones for a chat on a remote paired host;
    • the alert a local host pushed to its phones directly.
  • Terminal agents are unchanged. They have no read capture, so the extra read is ignored for them.

Why

Root cause: the workspace toggle was the only read path that never sent a structured read. Opening the chat (the on-screen auto-ack) and Activity/dashboard Mark as read (acknowledgeAgents(..., 'explicit')) both go through emitAgentSubjectReads. This reuses that same path instead of adding anything new.

I didn't call acknowledgeAgents from the workspace toggle. It also writes Activity acknowledgement stamps and clears manual-unread turns, so marking a workspace read would start marking its Activity threads read. That's a separate product call.

No overlap with #30900: that PR doesn't touch the slice or the subject-read capture/listener path.

Linked Issue

Linear STA-11936 (no GitHub issue).

Visual Proof

N/A: nothing changes on the desktop. The change is that the phone's tray alert is withdrawn, which needs a paired host and a phone running a real chat turn. The regression test covers the emitted read, and the downstream dismissal is the same chain Activity's Mark as read already uses.

Testing

  • Added a test showing workspace Mark as read emits an explicit read for a cleared chat subject. It fails on main (expected [] to deeply equal ['explicit']) and passes with the fix.

  • Ran pnpm test src/renderer/src/store/slices/workspace-attention src/renderer/src/hooks/useReadOnScreenAttention.test.ts, check:code-quality:changed and check:react-doctor:changed.

  • Not run: a live phone tray check, for the reasons under Visual Proof.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Review

Renderer-only. One call added in workspace-attention-slice.ts; removeAndDismiss now returns what it removed instead of a boolean.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Platforms: renderer-only, so no platform differences.
  • Remote/SSH: remote-host chats are the case this fixes. The host acknowledgement RPC is the one other read paths already send, so mixed versions behave as they do for those paths.
  • Folder workspaces: this path doesn't depend on git, so they work the same.
  • Mobile: no phone change needed. The phone already handles these dismissals.

Still not covered (out of scope, pre-existing):

  • alerts from before a desktop restart, when no unread markers remain;
  • pushes sent by a headless host;
  • pushes that carry no notification id.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Positioned chat alerts only retire with an explicit read naming their
journal boundary; the workspace toggle sent pane keys alone.
@AmoabaKelvin
AmoabaKelvin marked this pull request as ready for review October 26, 2026 19:43
@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c438c5c5-2eb3-412c-958c-a9837081a2de
Commits

Reviewing files that changed from the base of the PR and between bd2f463 and ab05145.

Files selected for processing: 2
  • src/renderer/src/store/slices/workspace-attention/workspace-attention-slice.ts
  • src/renderer/src/store/slices/workspace-attention/workspace-unread-on-screen-characterization.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

Walkthrough

removeAndDismiss now returns removed-attention details. When workspace unread state is cleared, the slice uses those details to emit explicit agent-subject reads for removed pane keys. Screen-arrival handling checks whether attention was removed or screenArrived is true before settling workspace unread flags. A test verifies the explicit capture intent and emitted structured read.

Priority: Normal

Merge Risk: Minimal · up to ab051

Workspace Mark as read now propagates structured-chat reads without an identified blocker. The change is ready for normal merge checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the primary change: workspace Mark as read now clears chat notifications on phones.
Description check Passed The description is detailed and covers the user impact, implementation, rationale, testing, scope, compatibility, and checklist. It references Linear issue STA-11936 but does not provide an issue link…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is detailed and covers the user impact, implementation, rationale, testing, scope, compatibility, and checklist. It references Linear issue STA-11936 but does not provide an issue link, and the full lint, typecheck, test, and build checklist remains unchecked.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AmoabaKelvin
AmoabaKelvin merged commit b590977 into main Oct 26, 2026
58 checks passed
@AmoabaKelvin
AmoabaKelvin deleted the mobile-mark-read-phone-alert branch October 26, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant